package com.dms.modules.product.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 商品评论实体类
 */
@Data
@Accessors(chain = true)
@TableName(value = "product_comment", autoResultMap = true)
@ApiModel(value = "商品评论实体", description = "商品评论信息")
public class ProductComment {

    @ApiModelProperty("评论ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("商品ID")
    private Long productId;

    @ApiModelProperty("用户ID")
    private Long userId;

    @ApiModelProperty("订单ID")
    private Long orderId;

    @ApiModelProperty("评分：1-5星")
    private Integer rating;

    @ApiModelProperty("评论内容")
    private String content;

    @ApiModelProperty("评论图片，JSON格式")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> images;

    @ApiModelProperty("商家回复")
    private String reply;

    @ApiModelProperty("回复时间")
    private LocalDateTime replyTime;

    @ApiModelProperty("点赞数")
    private Integer likeCount;

    @ApiModelProperty("状态：0-待审核，1-已通过，2-已拒绝")
    private Integer status;

    @ApiModelProperty("是否已评价：0-未评价 1-已评价")
    private Boolean hasReviewed;

    @ApiModelProperty("是否匿名")
    private Boolean isAnonymous;

    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;

    @ApiModelProperty("是否删除")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty("审核备注")
    private String auditRemark;

    @ApiModelProperty("审核时间")
    private LocalDateTime auditTime;
} 